X-Git-Url: https://git.gag.com/?a=blobdiff_plain;f=grc%2Fblocks%2Fvariable_chooser.xml;h=ee41f26db98e750f20a613df20dd531fe1fcdbab;hb=645768d1b067fe83ccc65f4a834ee384ea4560d9;hp=2f0e9bbf39d045009a86d7fc86e65ad23591ade2;hpb=9988664127b367fa8fee4409f8460673d6f265e1;p=debian%2Fgnuradio diff --git a/grc/blocks/variable_chooser.xml b/grc/blocks/variable_chooser.xml index 2f0e9bbf..ee41f26d 100644 --- a/grc/blocks/variable_chooser.xml +++ b/grc/blocks/variable_chooser.xml @@ -11,8 +11,10 @@ variable_chooser from gnuradio.wxgui import forms self.$(id) = $(id) = $value - self.$(id)_chooser = forms.$(type)( - parent=self.GetWin(), + #set $parent = $notebook() and 'self.%s.GetPage(%s)'%$notebook() or 'self' +#set $win = 'self._%s_chooser'%$id +$win = forms.$(type)( + parent=$(parent).GetWin(), value=self.$id, callback=self.set_$(id), #if $label() @@ -26,14 +28,13 @@ style=$style, #end if ) -#set $grid_pos = $grid_pos() -#if not grid_pos -self.Add(self.$(id)_chooser) +#if not $grid_pos() +$(parent).Add($win) #else -self.GridAdd(self.$(id)_chooser, $grid_pos[0], $grid_pos[1], $grid_pos[2], $grid_pos[3]) +$(parent).GridAdd($win, $(', '.join(map(str, $grid_pos())))) #end if self.set_$(id)($value) - self.$(id)_chooser.set_value($id) + self._$(id)_chooser.set_value($id) Label label @@ -98,6 +99,12 @@ self.GridAdd(self.$(id)_chooser, $grid_pos[0], $grid_pos[1], $grid_pos[2], $grid grid_pos + + Notebook + notebook + + notebook + $value in $choices not $labels or len($labels) == len($choices) @@ -109,5 +116,7 @@ The choices must be a list of possible values. \ Leave labels empty to use the choices as the labels. Use the Grid Position (row, column, row span, column span) to position the graphical element in the window. + +Use the Notebook Param (notebook-id, page-index) to place the graphical element inside of a notebook page.