Search Results

Search found 1071 results on 43 pages for 'widgets'.

Page 5/43 | < Previous Page | 1 2 3 4 5 6 7 8 9 10 11 12  | Next Page >

  • Customizing Django form widgets? - Django

    - by RadiantHex
    Hi folks, I'm having a little problem here! I have discovered the following as being the globally accepted method for customizing Django admin field. from django import forms from django.utils.safestring import mark_safe class AdminImageWidget(forms.FileInput): """ A ImageField Widget for admin that shows a thumbnail. """ def __init__(self, attrs={}): super(AdminImageWidget, self).__init__(attrs) def render(self, name, value, attrs=None): output = [] if value and hasattr(value, "url"): output.append(('<a target="_blank" href="%s">' '<img src="%s" style="height: 28px;" /></a> ' % (value.url, value.url))) output.append(super(AdminImageWidget, self).render(name, value, attrs)) return mark_safe(u''.join(output)) I need to have access to other field of the model in order to decide how to display the field! For example: If I am keeping track of a value, let us call it "sales". If I wish to customize how sales is displayed depending on another field, let us call it "conversion rate". I have no obvious way of accessing the conversion rate field when overriding the sales widget! Any ideas to work around this would be highly appreciated! Thanks :)

    Read the article

  • PyGTK: Packing widgets before tabs in a gtk.Notebook

    - by Ben Ashton
    Basically, what I want to do is put some buttons before the tabs in a gtk.Notebook. I tried making my own notebook type widget and it worked well, but it would have required lots more work to make it as flexible as I would like, also it wasn't as efficient. Here is a mock-up of what I'm trying to achieve: http://imagebin.ca/view/84SC0d.html Any ideas would be much appreciated, thanks. Ben.

    Read the article

  • Clickable widgets in android

    - by Leif Andersen
    The developer documentation has seemed to have failed me here. I can create a static widget without thinking, I can even create a widget like the analogue clock widget that will update itself, however, I can not for the life of me figure out how to create a widget that reacts to when a user clicks on it. Here is the best code sample that the developer documentation gives to what a widget activity should contain (the only other hint being the API demos, which only creates a static widget): public class ExampleAppWidgetProvider extends AppWidgetProvider { public void onUpdate(Context context, AppWidgetManager appWidgetManager, int[] appWidgetIds) { final int N = appWidgetIds.length; // Perform this loop procedure for each App Widget that belongs to this provider for (int i=0; i<N; i++) { int appWidgetId = appWidgetIds[i]; // Create an Intent to launch ExampleActivity Intent intent = new Intent(context, ExampleActivity.class); PendingIntent pendingIntent = PendingIntent.getActivity(context, 0, intent, 0); // Get the layout for the App Widget and attach an on-click listener to the button RemoteViews views = new RemoteViews(context.getPackageName(), R.layout.appwidget_provider_layout); views.setOnClickPendingIntent(R.id.button, pendingIntent); // Tell the AppWidgetManager to perform an update on the current App Widget appWidgetManager.updateAppWidget(appWidgetId, views); } } } from: The Android Developer Documentation's Widget Page So, it looks like pending intent is called when the widget is clicked, which is based off of an intent (I'm not quite sure what the difference between an intent and a pending intent is), and the intent is for the ExampleActivity class. So I made my sample activity class a simple activity that when created, would create a mediaplayer object, and start it (it wouldn't ever release the object, so it would eventually crash, here is it's code: @Override public void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); MediaPlayer mp = MediaPlayer.create(getApplicationContext(), R.raw.sound); mp.start(); } However, when I added the widget to the home screen, and clicked on it, nothing played, in fact, nothing played when I set the update timer to just a few hundred milliseconds (in the appwidget provider xml file). Furthermore, I set break points and found out that not only was it never reaching the activity, but no break points I set would ever get triggered. (I still haven't figured out why that is), however, logcat seemed to indicate that the activity class file was being run. So, is there anything I can do to get an appwidget to respond to a click? As the onClickPendingIntent() method is the closest I have found to a onClick type of method. Thank you very much.

    Read the article

  • pygtk - dynamically update the widgets taking input from the gtk combo box

    - by Webrsk
    On selecting value from 1 to 10 from gtk combox box it should populate the checkbox by taking combo box value as an input. Say for example if i select 5 then 5 checkbox will be generated. It works.. But the issue is after i selected 5 now im selecting next value as 3 from combo box then there 8 checkboxes are displayed. The old 5 checkbox didnt get replaced. Is there any way to refresh the vbox(which has the checkboxes) or update to a new value. Enviroment : FC10 , Glade 2 , Python 2.5 , GTK.

    Read the article

  • Adding multiple star rating widgets to one page

    - by diglettpotato
    I am using this jQuery plugin for star ratings: http://orkans-tmp.22web.net/star_rating/ Everything is going great, including using AJAX, etc. The problem is that I need to have many per page and can't quite figure out how to work with the selectors to achieve this. I think this is probably very easy for someone who knows their jQuery... Here's some code below... There are multiple kids per page, and I need one rating widget for each kid. I can set up each #rat to be unique with a kid attached to it, like #1rat, #2rat, etc. But then how would I set up the function to be run on each of them independently? <script type="text/javascript"> $(function(){ var kidval=1; //this needs to be setup for each kid... not just 1 var uidval=1; $('#rat').children().not("select, #rating_title").hide(); var $caption = $('<div id="caption"/>'); $('#rat').stars({ inputType: "select", oneVoteOnly: false, callback: function(ui, type, value) { $("#"+kidval+"messages").text("Saving...").fadeIn(30); $.post("vote.php", {rate: value, kid: kidval, uid: uidval}, function(json) { $("#"+kidval+"messages").text("Average"); ui.select(Math.round(json.avg)); $caption.text(" (" + json.votes + " votes, " + json.avg + " avg)"); $("#"+kidval+"messages").text("Rated " + value + " Thanks!").stop().css("opacity", 1).fadeIn(30); setTimeout(function(){ $("#"+kidval+"messages").fadeOut(1000) }, 2000); }, "json"); } }); $('#rat').stars("selectID", -1); $caption.appendTo(#rat); $('<div id="'+kidval+'messages"/>').appendTo(#rat); });

    Read the article

  • emacs - Widget Custom Theme

    - by Abdillah
    I'm starting using emacs. I know that everything of emacs is customizable. But, one thing I can't even found on internet is modifying the default emacs' widget's Look and Feel. Is there some way to custom it's background, shape, etc or just using UTF-8 character (for example checkbox using ? character)? Well, as a new user, I was quite boring with the customize interface. Some kind of I want to change onto a flat-styled ui or a better one.

    Read the article

  • How do I place widgets above and below a listview with Relative Layout

    - by Jay Askren
    I have a list view and want to put stuff both above(on the y axis) and below(y axis) it including images, text views, and a row of buttons. Below is a simplified version of what I am creating. Unfortunately the list covers(i.e. above on the z axis) the header so the header text is not visible instead of being underneath (on the y axis) <?xml version="1.0" encoding="utf-8"?> <RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android" android:layout_width="wrap_content" android:layout_height="wrap_content"> <TextView android:id="@+id/footer" android:text="footer" android:layout_height="wrap_content" android:layout_width="fill_parent" android:layout_alignParentBottom="true" /> <ListView android:id="@+id/list_view" android:layout_height="fill_parent" android:layout_width="fill_parent" android:layout_above="@id/footer" android:background="#ff9999ff"/> <TextView android:id="@+id/header" android:text="header" android:layout_height="wrap_content" android:layout_width="fill_parent" android:layout_alignParentTop="true" android:layout_above="@id/list_view" android:baselineAlignBottom="false" /> </RelativeLayout> Here is the corresponding Activity class: public class SampleListActivity extends Activity { @Override public void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.list_activity); } }

    Read the article

  • IE Security Warning with widgets

    - by superexsl
    Hey I'm creating an ASP.NET application which uses Facebook Connect and fbml tags. It also uses the LinkedIn widget. When I run this app in any browser, there are no warnings and everything works. However, in IE, a message like this comes up: Security Warning: The current webpage is trying to open a site in your Trusted sites list. Do you want to allow this? Current site:http://www.facebook.com Trusted site:http://localhost (same for LinkedIn.com). I know how to fix this from a client perspective and to stop the security warning showing up. However, is it possible to ensure this message doesn't come up as it could be off putting for users who don't know how to suppress this warning? I haven't tried uploading it to my webhost, so not sure if this message will appear for everyone in production. However, I always get it on my local machine. (None of my pages use SSL, so I don't think that's the issue. I tried using FB's HTTPS urls but that didn't make a difference). Thanks

    Read the article

  • Android: Use XML Layout for List Cell rather than Java Code Layout (Widgets)

    - by Stephen Finucane
    Hi, I'm in the process of making a music app and I'm currently working on the library functionality. I'm having some problems, however, in working with a list view (In particular, the cells). I'm trying to move from a simple textview layout in each cell that's created within java to one that uses an XML file for layout (Hence keeping the Java file mostly semantic) This is my original code for the cell layout: public View getView(int position, View convertView, ViewGroup parent) { String id = null; TextView tv = new TextView(mContext.getApplicationContext()); if (convertView == null) { music_column_index = musiccursor.getColumnIndexOrThrow(MediaStore.Audio.Media.TITLE); musiccursor.moveToPosition(position); id = musiccursor.getString(music_column_index); music_column_index = musiccursor.getColumnIndexOrThrow(MediaStore.Audio.Media.DISPLAY_NAME); musiccursor.moveToPosition(position); id += "\n" + musiccursor.getString(music_column_index); music_column_index = musiccursor.getColumnIndexOrThrow(MediaStore.Audio.Albums.ALBUM); musiccursor.moveToPosition(position); id += "\n" + musiccursor.getString(music_column_index); tv.setText(id); } else tv = (TextView) convertView; return tv; } And my new version: public View getView(int position, View convertView, ViewGroup parent) { View cellLayout = findViewById(R.id.albums_list_cell); ImageView album_art = (ImageView) findViewById(R.id.album_cover); TextView album_title = (TextView) findViewById(R.id.album_title); TextView artist_title = (TextView) findViewById(R.id.artist_title); if (convertView == null) { music_column_index = musiccursor.getColumnIndexOrThrow(MediaStore.Audio.Albums.ALBUM); musiccursor.moveToPosition(position); album_title.setText(musiccursor.getString(music_column_index)); //music_column_index = musiccursor.getColumnIndexOrThrow(MediaStore.Audio.Media.DISPLAY_NAME); //musiccursor.moveToPosition(position); music_column_index = musiccursor.getColumnIndexOrThrow(MediaStore.Audio.Media.TITLE); musiccursor.moveToPosition(position); artist_title.setText(musiccursor.getString(music_column_index)); } else{ cellLayout = (TextView) convertView; } return cellLayout; } The initialisation (done in the on create file): musiclist = (ListView) findViewById(R.id.PhoneMusicList); musiclist.setAdapter(new MusicAdapter(this)); musiclist.setOnItemClickListener(musicgridlistener); And the respective XML files: (main) <?xml version="1.0" encoding="utf-8"?> <LinearLayout xmlns:android="http://schemas.android.com/apk/res/android" android:orientation="vertical" android:layout_width="fill_parent" android:layout_height="fill_parent"> <ListView android:id="@+id/PhoneMusicList" android:layout_width="fill_parent" android:layout_height="fill_parent" /> <TextView android:id="@android:id/empty" android:layout_width="wrap_content" android:layout_height="0dip" android:layout_weight="1.0" android:text="@string/no_list_data" /> </LinearLayout> (albums_list_cell) <?xml version="1.0" encoding="utf-8"?> <RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android" android:id="@+id/albums_list_cell" android:layout_width="wrap_content" android:layout_height="wrap_content"> <ImageView android:id="@+id/album_cover" android:layout_alignParentLeft="true" android:layout_alignParentTop="true" android:layout_width="50dip" android:layout_height="50dip" /> <TextView android:id="@+id/album_title" android:layout_toRightOf="@+id/album_cover" android:layout_alignParentTop="true" android:layout_width="wrap_content" android:layout_height="wrap_content" /> <TextView android:id="@+id/artist_title" android:layout_toRightOf="@+id/album_cover" android:layout_below="@+id/album_title" android:layout_width="wrap_content" android:layout_height="15dip" /> </RelativeLayout> In theory (based on the tiny bit of Android I've done so far) this should work..it doesn't though. Logcat gives me a null pointer exception at line 96 of the faulty code, which is the album_title.setText line. It could be a problem with my casting but Google tells me this is ok :D Thanks for any help and let me know if you need more info!

    Read the article

  • Complex form widgets in Django

    - by Shekhar
    I am looking for good helper libraries to generate a rather complex form in Django. Dynamic field dependencies: Say if option a is selected certain fields are shown/hidden and subset of these are mandatory depending on option selection. Add more: On clicking "Add more" button that clones some widget. This is something which ToscaWidgets is capable of handle. http://toscawidgets.org/documentation/tw.dynforms/tutorial.html#growing Currently I am managing this with some jquery code however not completely satisfied. TIA

    Read the article

  • Tree Widgets on Rails

    - by Joe
    I would like to find some help building a tree interface in Rails. I've tried using jsTree but am having trouble integrating it properly into Rails. Thanks.

    Read the article

  • Python PyQT4 - Adding an unknown number of QComboBox widgets to QGridLayout

    - by ZZ
    Hi all, I want to retrieve a list of people's names from a queue and, for each person, place a checkbox with their name to a QGridLayout using the addWidget() function. I can successfully place the items in a QListView, but they just write over the top of each other rather than creating a new row. Does anyone have any thoughts on how I could fix this? self.chk_People = QtGui.QListView() items = self.jobQueue.getPeopleOffQueue() for item in items: QtGui.QCheckBox('%s' % item, self.chk_People) self.jobQueue.getPeopleOffQueue() would return something like ['Bob', 'Sally', 'Jimmy'] if that helps.

    Read the article

  • accessing widgets inside a GWT element

    - by flyingcrab
    I want to access the text elements inside this textbox in GWT from the main method (where I call it like this) DialogBox aBox = newCandidatePop.buildNewElecPopup(); aBox.center(); aBox.getWidget(); MiscUiTools.newCandidateHandler(aBox.firstName, aBox.surName); in newCandidateHandler i want to attach a click handler to the two text boxes However, the above doesnt quite work - I cant get access to the aBox.firstName elements because they are static methods -- I am wondering what is best practice, how would you code something like this up? static TextBox firstName = new TextBox(); static TextBox surName = new TextBox(); static DialogBox box; // public newCandidatePop() { // box = buildNewElecPopup(); // } static public DialogBox buildNewElecPopup() { DialogBox box = new DialogBox(); box.setAutoHideEnabled(true); box.setText("Add a New Candidate"); box.setAnimationEnabled(true); box.setGlassEnabled(true); Grid dialogGrid = new Grid(2, 3); dialogGrid.setPixelSize(250 , 125); dialogGrid.setCellPadding(10); dialogGrid.setWidget(0, 0, new HTML("<strong>First Name</strong>")); dialogGrid.setWidget(0, 1, firstName); dialogGrid.setWidget(1, 0, new HTML("<strong>Surname</strong>")); dialogGrid.setWidget(1, 1, surName); box.add(dialogGrid); return box; }

    Read the article

  • How to delete the widget from the stack in Qt

    - by Solitaire
    Hi, i am using Qstackedwidget to switch between the views, i will be able to traverse between the views, i am facing problem in some scenario, where i do not require the widgets, i want to remove them completely.. stackedwidget provides the functionality to removewidgets, still the ownership of the widget will be there, i mean widget will be hidden. i dont want this to be happen, when i call remove widget the widget should be deleted. how to handle this?

    Read the article

  • Attaching javascript events to form widgets

    - by user334017
    I have a form with a drop down menu and I want to do a javascript action whenever the user changes the selection. I imagine it is possible find the input later, using javascript, and attach an event to to it; but it seems like it would be easier if there was some sort of attribute or option that could be defined in form-configure(): e.g. $this->widgetSchema['menu'] = new sfWidgetFormChoice(array( ... 'onclick' => javascript function )); obviously this doesn't work, and it probably wouldn't be an onclick method either, but my question is how do you attach a javascript event to a input/widget?

    Read the article

  • are there any tree libraries/widgets for (n)curses

    - by phatmanace
    Hi - I wondered if there were any tree libraries available for (n)curses. I'm trying to write a component that shows a tree of folders & was curious if there was a prebuilt curses component that could do this. I've checked 'core' curses as well as libraries like CDK - and I can't seem to find anything. If none exists, I'm not averse to building my own - but I can't seem to locate any decent tutorials on doing this, so any help in this regard would also be much appreciated. Thanks, Ace

    Read the article

  • How to update widgets from a service?

    - by Franklin
    I have a background service that can be configured to perform some action every x minutes. I want to implement a widget that gets updated every time my service performs that action. However, I can't get the onUpdate method of my AppWidgetProvider called in any way, except when adding a widget to the homescreen. I tried sending APPWIDGET_UPDATE intents but onUpdate did not get called although the AppWidgetProvider did receive the intent since the onReceive method was called. Is there any way I can trigger widget updates from a service?

    Read the article

  • Adding classes to all form widgets in symfony

    - by rlahay
    Hi everyone, I am trying to find a better way to assign classes to form elements in symfony. Currently, I can't seem to get away from assigning each one manually. ie: $this->widgetSchema['title']->setAttribute("class","fieldInput"); $this->widgetSchema['tag_line']->setAttribute("class","fieldInput"); $this->widgetSchema['description']->setAttribute("class","fieldInput"); // etc Things I tried without success 1) looping through $this-widgetSchema, treating it as an array and setting attributes to each key 2) $this-widgetSchema-setAttribute() but this only applied the class to the label that was generated, not the form element There must be a way to hit all the fields without specifically directing them? Can anyone point me in the right direction?

    Read the article

  • What JavaScript table widgets you can recommend? [2]

    - by sdespolit
    As so far i've "found" Yahoo UI library and it fully conforms to my requirements. Also there is jqGrid that i'm using right now. If there are any alternatives? UPDATE: Please suggest libraries and don't seek for matching all the requirements listed below. [i'll check it for myself] My reqs are: rows adding, deletinig rows reoder (optionally with drag and drop) rows selection inline editing json data over xhr (optional) simple integration with backbone.js disclaimer: there was almost the same question 2 years ago

    Read the article

  • Resizing qt widgets when their children are hidden

    - by laura
    I have the situation in the following image: How would I go about resizing the widget when the retry child is hidden so that it looks as in the first image? The main layout is a QVBoxLayout, the retry child is a widget with a QVBoxLayout as well. I've tried the following: update() updateGeometry() setGeometry(childrenRect()) layout()-activate() on the main widget as soon as I've set the retry widget to hidden. Do I need to intercept some event to do this?

    Read the article

< Previous Page | 1 2 3 4 5 6 7 8 9 10 11 12  | Next Page >